import pandas as pd

class Parser(object):

    def __init__(self,
                 file_path : str,
                 pkg_type : str,
                 sep : str,
                 opts: dict):

        self.df = pd.read_csv(file_path, sep=sep, dtypes=str, **opts)
        self.sep = sep
        self.pkg_type = pkg_type
        self.begin_point = None
        self.coordinates = []

    def coordinates_list(self):
        self.coordinates = self.df.values.tolist()
        if self.begin_point:
            row = self.begin_point.split(self.sep)
            try:
                begin = self.coordinates.index(row)
                return self.coordinates[begin:]
            except:
                pass
        return self.coordinates

    def set_begin_point(self, coordinate : str):
        self.begin_point = coordinate
        return self
